package com.xyrl.starter.lock.redis;

import com.xyrl.starter.lock.redis.lock.DistributedLock;
import com.xyrl.starter.lock.redis.lock.RedisDistributedLock;
import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 同步锁 配置
 *
 * @author zhongp
 * @title: DistributedLockAutoConfiguration
 * @projectName xyrl
 * @description: TODO
 * @date 2019/12/09 15:04
 */
@Configuration
@AutoConfigureAfter(RedisAutoConfiguration.class)
public class DistributedLockAutoConfiguration {

    @Bean
    public DistributedLock redisDistributedLock(RedissonClient redissonClient) {
        return new RedisDistributedLock(redissonClient);
    }

}
